package com.four.controller;

import com.four.service.PermissionService;
import com.four.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName:PermissionController
 * Description:
 * date:2022/10/14 9:48
 *
 * @since JDK 1.8
 */
@RestController
@RequestMapping("/permission")
public class PermissionController {
    @Autowired
    private PermissionService permissionService;
    @PostMapping("/leftpermission")
    public Result leftPermission(){
        return permissionService.findByAdminId();
    }
    @GetMapping("/list")
    public Result list(Integer roleId){
        return permissionService.findByRoleId(roleId);
    }
    @PostMapping("/qr")
    public Result qr(Integer roleId,Integer[] permissionIds){
        return permissionService.qr(roleId,permissionIds);
    }

}
